package com.example.demo.observer;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class AnnotationDemoListener {

    @EventListener
    public void onApplicationEvent(DemoEvent event) {
        String msg = event.getMessage();
        System.out.println("注解方式=======接收到的信息是："+msg);
    }

}
